package lab03.test01;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Test01 {
    public static void main(String[] args) {
        //1.字符流读

            String path="F:\\新建文本文档.txt";
        BufferedReader reader= null;
        try {
            reader = new BufferedReader(new FileReader(path));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        String line ="";
            try {
                while ((line=reader.readLine())!=null) {
                    System.out.println(line);
                }
                reader.close();
                 } catch (IOException e) {
                e.printStackTrace();
            }finally {
                assert reader != null;
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

    }
}
